{% extends "base.tmpl" %}
{% block title %}TogetherJS Bookmarklet{% endblock %}
{% block styles %}

<script>

function bookmarklet() {
  var s = "window._TogetherJSBookmarklet = true;";
  s += "s=document.createElement('script');";
  s += "s.src=" + JSON.stringify(TogetherJS.baseUrl + "/togetherjs.js") + ";";
  s += "document.head.appendChild(s);";
  s = "(function () {" + s + "})();void(0)";
  return "javascript:" + encodeURIComponent(s);
};

window.addEventListener("load", function () {
  var el = document.getElementById("towtruck-bookmarklet");
  el.href = bookmarklet();
}, false);

</script>

{% endblock %}

{% block body %}

<div class="container">

<h1>TogetherJS Bookmarklet</h1>

<p>
  To use this bookmarklet, drag the button below to your bookmark toolbar:
</p>

<p>
  <a id="towtruck-bookmarklet" class="button fade-half" href="#">Start TogetherJS</a>
</p>

</div>

{% endblock %}
